﻿#define _CRT_SECURE_NO_WARNINGS
#include "SList.h"


void SLTTest()
{
	//测试尾插
	/*SLTNode* plist = NULL;
	SLTPushBack(&plist, 1);
	SLTPrint(plist);
	SLTPushBack(&plist, 2);
	SLTPushBack(&plist, 3);
	SLTPushBack(&plist, 4);
	SLTPrint(plist);*/

	//测试头插
	/*SLTNode* plist = NULL;
	SLTPushFront(&plist, 1);
	SLTPrint(plist);
	SLTPushFront(&plist, 2);
	SLTPushFront(&plist, 3);
	SLTPushFront(&plist, 4);
	SLTPrint(plist);*/

	//测试尾删
	/*SLTNode* plist = NULL;
	SLTPushFront(&plist, 1);
	SLTPushFront(&plist, 2);
	SLTPushFront(&plist, 3);
	SLTPushFront(&plist, 4);
	SLTPrint(plist);
	SLTPopBack(&plist);
	SLTPopBack(&plist);
	SLTPopBack(&plist);
	SLTPrint(plist);*/

	//测试头删
	/*SLTNode* plist = NULL;
	SLTPushFront(&plist, 1);
	SLTPushFront(&plist, 2);
	SLTPushFront(&plist, 3);
	SLTPushFront(&plist, 4);
	SLTPrint(plist);
	SLTPopFront(&plist);
	SLTPopFront(&plist);
	SLTPopFront(&plist);
	SLTPrint(plist);*/

	//测试在指定位置之前插入数据
	//SLTNode* plist = NULL;
	//SLTPushFront(&plist, 1);
	//SLTPushFront(&plist, 2);
	//SLTPushFront(&plist, 3);
	//SLTPushFront(&plist, 4);
	//SLTPrint(plist);
	//SLTNode* find = SLTFind(plist, 3);
	///*if (find == NULL)
	//{
	//	printf("0");

	//}
	//else
	//{
	//	printf("1");
	//}*/
	//SLTInsertFront(&plist, find, 11);
	//SLTPrint(plist);


	//测试在指定位置之后插入数据
	/*SLTNode* plist = NULL;
	SLTPushFront(&plist, 1);
	SLTPushFront(&plist, 2);
	SLTPushFront(&plist, 3);
	SLTPushFront(&plist, 4);
	SLTPrint(plist);
	SLTNode* find = SLTFind(plist, 3);

	SLTInsertAfter(&plist, find, 11);
	SLTPrint(plist);*/

	//测试删除指定位置pos结点
	/*SLTNode* plist = NULL;
	SLTPushFront(&plist, 1);
	SLTPushFront(&plist, 2);
	SLTPushFront(&plist, 3);
	SLTPushFront(&plist, 4);
	SLTPrint(plist);
	SLTNode* find = SLTFind(plist, 3);
	SLTErase(&plist, find);
	SLTPrint(plist);*/


	//测试删除指定位置pos之后的结点
	//SLTNode* plist = NULL;
	//SLTPushFront(&plist, 1);
	//SLTPushFront(&plist, 2);
	//SLTPushFront(&plist, 3);
	//SLTPushFront(&plist, 4);
	//SLTPrint(plist);
	//SLTNode* find = SLTFind(plist, 3);
	//SLTEraseAfter(find);
	//SLTPrint(plist);

	//测试销毁链表
	SLTNode* plist = NULL;
	SLTPushFront(&plist, 1);
	SLTPushFront(&plist, 2);
	SLTPushFront(&plist, 3);
	SLTPushFront(&plist, 4);
	SLTPrint(plist);
	SLTDestroy(&plist);
	SLTPrint(plist);

}


int main()
{
	SLTTest();
	return 0;
}


//完结撒花✿✿ヽ(°▽°)ノ✿